Skip to content

fix(journey): conditional legacy handle compat (EVO-1922)#99

Merged
dpaes merged 1 commit into
developfrom
danilocarneiro/evo-1922-jornadas-conditional-jornadas-salvas-com-handle-path-id
Jun 25, 2026
Merged

fix(journey): conditional legacy handle compat (EVO-1922)#99
dpaes merged 1 commit into
developfrom
danilocarneiro/evo-1922-jornadas-conditional-jornadas-salvas-com-handle-path-id

Conversation

@daniloleonecarneiro

Copy link
Copy Markdown

Summary

Follow-up do EVO-1902/D13. O EVO-1902 corrigiu o FE para emitir o sourceHandle do conditional sem o prefixo (path.id cru). Isso conserta jornadas novas/re-salvas, mas jornadas já salvas têm edges com sourceHandle = "path-<id>". O matching do workflow (edge.sourceHandle === nodeResult.nextNodeHandle, com nextNodeHandle = path.id cru) não casava o handle legado → o ramo VERDADEIRO ainda ia pro ELSE nessas jornadas.

Fix (abordagem 1, retrocompatível): tornar o matching tolerante ao prefixo. Novo util normalizeConditionalPathHandle remove um único prefixo path- opcional dos dois lados antes de comparar. Assim:

  • legado (path-<id> no edge) + node cru (<id>) → casa
  • novo (<id> no edge) + node cru (<id>) → casa
  • else → inalterado

Sem regressão no Split: split-variant-<id> não começa com path-, então a normalização o devolve intacto; o Split continua casando no handle prefixado completo nos dois lados.

Arquivos

  • src/modules/temporal/workflows/conditional-path-handle.util.ts (novo) — helper puro normalizeConditionalPathHandle.
  • src/modules/temporal/workflows/journey-execution.workflow.ts — matching normaliza ambos os lados.
  • src/modules/temporal/workflows/conditional-path-handle.util.spec.ts (novo) — 9 casos (legado/novo/else/split/non-string/path-path-/pathway-).

Test plan

  • conditional-path-handle.util.spec.ts + conditional.node.spec.ts + split.node.spec.ts: 32 passed.
  • journey-execution.coverage.spec.ts (parity guard): 26 passed.
  • tsc -p tsconfig.json --noEmit: clean.

EVO-1922

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @daniloleonecarneiro, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@daniloleonecarneiro daniloleonecarneiro self-assigned this Jun 25, 2026

@dpaes dpaes left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — deep adversarial review (card + authoritative diff + real code): acceptance criteria met, no blocking findings. Merge intentionally held to land in the coordinated dependency-order pass. Branch is clean vs develop.

@dpaes dpaes merged commit 8fdb7e3 into develop Jun 25, 2026
3 checks passed
@dpaes dpaes deleted the danilocarneiro/evo-1922-jornadas-conditional-jornadas-salvas-com-handle-path-id branch June 25, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants